package org.six11.ss.server;

import java.io.IOException;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.six11.util.adt.MultiState;

/**
 * 
 *
 * @author Gabe Johnson <johnsogg@cmu.edu>
 */
public class LogoutWebActionHandler extends WebActionHandler {

  /**
   * @param actionName
   * @param jsp
   * @param ms
   */
  public LogoutWebActionHandler(String actionName, String jsp, MultiState ms) {
    super(actionName, jsp, ms);
  }

  /**
   * 
   */
  @Override
  public void handle(HttpServletRequest req, HttpServletResponse resp, ServletContext context)
      throws ServletException, IOException {
    req.setAttribute("formerUserName", req.getSession().getAttribute("userName"));
    req.getSession().invalidate();
    forwardTo(jsp, req, resp, context);
  }

}
